<template>
  <div>
    <span>你好 {{ name }} {{ title }}</span>
    <button @click="onClick1">点我，修改name</button>
    <button @click="onClick2">点我，修改title</button>
  </div>
</template>

<script>
export default {
  name: "HelloWorld",

  props: ["name", "title"],

  methods: {
    onClick1() {
      this.$emit("update:name", "里斯");
    },
    onClick2() {
      this.$emit("update:title", "我好");
    },
  },
};
</script>
